<template>
    <Header />

    <!-- 手机端 -->
    <div class="myFavorites-phone hidden-sm-and-up">
        <titleBar title="我的历史" />
        <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
            <el-tab-pane label="展会(12)" name="first">

                <div class="exhibitionList-container pdt20">
                    <div class="exhibition-item" v-for="(item, index) in 7" :key="index">
                        <img class="item-image" src="../static/image.png" alt="">
                        <div class="item-info">
                            <div class="item-title">
                                2023 年上海会展业创新发展峰会暨第九届“国际组展人之声”论坛
                            </div>
                            <div>
                                <div>
                                    <div class="item-city">-琶洲市</div>
                                    <div class="item-address">-广东省琶洲市九星大地会展中心</div>
                                    <div class="item-time">-2024年1月11日-1月13日</div>
                                </div>
                                <div class="item-btn">
                                    <el-button type="primary" round>热订中</el-button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </el-tab-pane>
            <el-tab-pane label="酒店(12)" name="second">
                <div class="pd20">
                    <phoneHotel v-for="item in 3" :key="item"
                        :imageUrl="'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg'"
                        :hotelName="'深圳海棠湾君悦酒店'" :hotelAddress="'杭州市余杭区高教路970号'" :originalPrice="2000"
                        :discountedPrice="340" :distance="'距离展会1.2km'" />
                </div>
            </el-tab-pane>

        </el-tabs>
    </div>

    <!-- PC端 -->
    <div class="myFavorites hidden-xs-only">
        <titleBar title="我的历史" style="margin-top: 30px;" />
        <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
            <el-tab-pane label="展会(12)" name="first">

                <div class="exhibitionList-container pdt20">
                    <div class="exhibition-item" v-for="(item, index) in 7" :key="index" @click="goDetailPage">
                        <img class="item-image" src="../static/image.png" alt="">
                        <div class="item-info">
                            <div class="item-title">
                                2023 年上海会展业创新发展峰会暨第九届“国际组展人之声”论坛
                            </div>
                            <div>
                                <div>
                                    <div class="item-city">-琶洲市</div>
                                    <div class="item-address">-广东省琶洲市九星大地会展中心</div>
                                    <div class="item-time">-2024年1月11日-1月13日</div>
                                </div>
                                <div class="item-btn">
                                    <el-button type="primary" round>热订中</el-button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </el-tab-pane>
            <el-tab-pane label="酒店(12)" name="second">
                <div class="hotel-item mt20">
                    <div class="hotel-name">
                        <div>
                            深圳海棠湾君悦酒店
                        </div>
                        <div>
                            <el-rate disabled size="large" v-model="hotelStar" />
                        </div>
                    </div>
                    <div class="hotel-address">
                        <div>
                            三亚 海棠区 海棠湾镇海棠北路68号
                        </div>
                        <div class="showMap">
                            显示地图
                        </div>
                    </div>
                    <div class="peizhi">
                        大床/双床/早餐
                    </div>
                    <div class="hotel-content">
                        <div class="hotel-imgs">
                            <el-carousel>
                                <el-carousel-item v-for="item in 4" :key="item">
                                    <img class="swiper-image" src="../static/image.png" alt="">
                                </el-carousel-item>
                            </el-carousel>
                        </div>
                        <div class="info-container">
                            <div class="price-container">
                                <div class="origin-price">
                                    门市价: ￥ 2000
                                </div>
                                <div class="price">
                                    <span>¥</span>
                                    <span class="real-price" style="margin-bottom: 12px;">637</span>
                                    <span>起</span>
                                </div>
                                <div class="tag">
                                    <el-tag size="large">距展会1.2km</el-tag>
                                </div>
                            </div>
                            <div class="hotel-info">
                                深圳国际会展中心希尔顿酒店位于深圳市宝安区福海街道的会展新城片区，紧邻亚太区综...
                            </div>
                            <div class="map-contaienr2">
                                <div class="hotel-map">
                                    <img class="mini-map" src="../static/map.jpg" alt="">
                                </div>
                                <div class="map-into">
                                    <div class="map-juli">
                                        <div>
                                            地铁1.1km
                                        </div>
                                        <div>
                                            飞机8.1km
                                        </div>
                                        <div>
                                            火车站1.2km
                                        </div>
                                    </div>
                                    <div class="watchMap">
                                        查看地图
                                    </div>

                                </div>
                            </div>
                            <div class="service">
                                <div>24小时前台服务</div>
                                <div class="cursor" @click="gotoHotelDetail">详情</div>
                            </div>
                        </div>
                    </div>

                </div>
            </el-tab-pane>

        </el-tabs>
    </div>
</template>
<script lang="ts" setup>
    import Header from '@/components/Header.vue'
    import titleBar from '@/components/titleBar.vue'
    import { ref } from 'vue'
    import type { TabsPaneContext } from 'element-plus'
    import phoneHotel from '@/components/phoneHotel.vue'
    const activeName = ref('first')
    const hotelStar = ref(4)
    const handleClick = (tab: TabsPaneContext, event: Event) => {
        console.log(tab, event)
    }

</script>

<style lang="scss" scoped>
    @import '@/assets/variables.scss';


    .hotel-item {
        background-color: #FAFAFA;
        padding: 20px;
        padding: 20px;
        border-radius: 5px;
        margin-bottom: 20px;

        .hotel-room {
            background-color: #fff;
            padding: 20px;
            margin-top: 20px;
            border-radius: 5px;
            margin-bottom: 20px;

            .room-intro {
                display: flex;
                padding-bottom: 30px;
                border-bottom: 1px solid #D8D8D8;

                .room-img {
                    width: 30%;

                    img {
                        width: 100%;
                        height: 100%;
                        object-fit: cover;
                    }
                }

                .room-guige {
                    width: 40%;
                    margin-left: 20px;

                    p {
                        margin-bottom: 10px;
                    }
                }

                .room-name {
                    width: 28%;
                    margin-left: 20px;
                    margin-top: 30px;

                    .name {
                        font-size: 24px;
                        font-weight: 600;
                        margin-bottom: 10px;
                    }

                    .room-descri {
                        margin-bottom: 10px;
                    }

                    .room-num {
                        color: #356CEB;
                    }
                }
            }

            .choose-room {
                display: flex;
                align-items: center;
                justify-content: space-between;
                padding: 0 20px;
                padding-bottom: 30px;
                border-bottom: 1px solid #D8D8D8;
                margin-top: 20px;

                .room-zaocan {
                    color: #356CEB;
                }

                .room-price {
                    display: flex;
                    align-items: center;

                    .price-contaienr {
                        margin-right: 80px;
                        display: flex;
                        flex-direction: column;
                        align-items: center;

                        .origin-price {
                            // 删除线
                            text-decoration: line-through;
                            color: #999;
                        }

                        .price {
                            color: #356CEB;

                            .real-price {

                                font-size: 36px;
                                margin: 0px 5px;
                            }
                        }
                    }

                    .yudin-btn {
                        .el-button {
                            width: 100px;
                        }
                    }
                }
            }
        }

        .hotel-name {
            display: flex;
            font-size: 28px;
            margin-bottom: 20px;
            font-weight: 500;
            margin-right: 10px;

            .el-rate {
                margin-left: 10px;
                font-size: 28px;
            }
        }

        .hotel-address {
            display: flex;

            margin-bottom: 20px;

            .showMap {
                margin-left: 20px;
                color: #356CEB;
                cursor: pointer;
            }
        }

        .peizhi {
            margin-bottom: 20px;
            color: #356CEB;
        }

        .hotel-content {
            display: flex;
            justify-content: space-between;

            .hotel-imgs {
                width: 55%;

                .swiper-image {
                    width: 100%;
                    height: 300px;
                    object-fit: cover;
                }
            }

            .info-container {
                width: 40%;

                .price-container {
                    display: flex;
                    justify-content: space-around;
                    align-items: center;

                    .origin-price {
                        // 删除线
                        text-decoration: line-through;
                        color: #999;
                    }

                    .price {
                        display: flex;
                        align-items: center;
                        color: #356CEB;

                        .real-price {
                            margin-bottom: 12px;
                            font-size: 36px;
                            margin: 0px 5px;
                        }
                    }

                    .tag {
                        display: flex;
                        text-align: right;
                    }
                }

                .hotel-info {
                    margin-bottom: 20px;
                }

                .map-contaienr2 {
                    display: flex;
                    width: 100%;

                    .hotel-map {
                        width: 100px;
                        height: 100px;

                        .mini-map {
                            width: 100%;
                            height: 100%;
                            object-fit: cover;
                        }
                    }
                }

                .service {
                    display: flex;
                    justify-content: space-between;
                    color: #356CEB;
                    margin-top: 20px;
                }

                .map-into {
                    display: flex;
                    flex-direction: column;
                    width: 90%;

                    .map-juli {
                        width: 100%;
                        justify-content: space-around;
                        display: flex;
                    }

                    .watchMap {
                        color: #356CEB;
                        display: flex;
                        cursor: pointer;
                        margin-left: 12px;
                        margin-top: 30px;
                    }
                }
            }
        }
    }

    :deep(.el-tabs__item) {
        padding: 0 15px !important;
    }

    :deep(.el-tabs__header) {
        margin: 0;
    }

    :deep(.el-tabs__item) {
        height: 60px;
    }

    :deep(.el-tabs__nav-scroll) {
        height: 60px;
        line-height: 60px;
    }

    .myFavorites-phone {
        max-width: $border-primary-max-width;
        margin: 0 auto;



        .exhibitionList-container {
            display: flex;
            justify-content: center;
            align-items: center;
            flex-wrap: wrap;

            max-width: $border-primary-max-width;
            margin: 0 auto;

            .exhibition-item:hover {
                box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.3);
            }

            .exhibition-item {
                border-radius: 10px;
                width: 90%;
                margin-bottom: 40px;
                border: 1px solid #ccc;

                .item-image {
                    width: 100%;
                    height: 200px;
                    border-radius: 10px 10px 0 0;
                    object-fit: cover;

                }

                .item-info {
                    padding: 10px 20px 20px 20px;

                    .item-title {
                        font-size: 20px;
                        font-weight: 700;
                        color: #475669;
                        margin-bottom: 10px;
                    }

                    .item-city {
                        font-size: 14px;
                        color: #475669;
                        margin-bottom: 10px;
                    }

                    .item-address {
                        font-size: 14px;
                        color: #475669;
                        margin-bottom: 10px;
                    }

                    .item-time {
                        font-size: 14px;
                        color: #475669;
                        margin-bottom: 10px;
                    }

                    .item-btn {
                        display: flex;
                        justify-content: flex-end;
                    }
                }

            }
        }

    }

    .myFavorites {
        max-width: $border-primary-max-width;
        margin: 0 auto;

        .exhibitionList-container {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;

            max-width: $border-primary-max-width;
            margin: 0 auto;

            .exhibition-item:hover {
                box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.3);
            }

            .exhibition-item {
                border-radius: 10px;
                width: 32%;
                margin-bottom: 40px;
                border: 1px solid #ccc;

                .item-image {
                    width: 100%;
                    height: 200px;
                    border-radius: 10px 10px 0 0;
                    object-fit: cover;

                }

                .item-info {
                    padding: 10px 20px 20px 20px;

                    .item-title {
                        font-size: 20px;
                        font-weight: 700;
                        color: #475669;
                        margin-bottom: 10px;
                    }

                    .item-city {
                        font-size: 14px;
                        color: #475669;
                        margin-bottom: 10px;
                    }

                    .item-address {
                        font-size: 14px;
                        color: #475669;
                        margin-bottom: 10px;
                    }

                    .item-time {
                        font-size: 14px;
                        color: #475669;
                        margin-bottom: 10px;
                    }

                    .item-btn {
                        display: flex;
                        justify-content: flex-end;
                    }
                }

            }
        }

    }
</style>